#ifndef VALUE_H
#define VALUE_H
#include <string>
#include <sstream>
class Value
{
protected:
	std::string type;
public:
	Value(const std::string& Type): type(Type) {}
	virtual ~Value() {};
	std::string getType() const {return type;}
	virtual void assign(const Value& rhs) {type = rhs.type;}
};
class ValueInt: public Value
{
	int data; // never returned to be calced, but calc itself!
public:
	ValueInt(int Data = 0): data(Data), Value("int") {}
	~ValueInt() {}
	ValueInt add(const ValueInt& rhs) const {return ValueInt(data + rhs.data);}
	ValueInt sub(const ValueInt& rhs) const {return ValueInt(data - rhs.data);}
	ValueInt mul(const ValueInt& rhs) const {return ValueInt(data * rhs.data);}
	ValueInt div(const ValueInt& rhs) const {return ValueInt(data / rhs.data);}
	int cmp(const ValueInt& rhs) const {return data - rhs.data;}
	ValueInt assign(const ValueInt& rhs) {Value::assign(rhs); data = rhs.data; return *this;}
	std::string str() const //const string?
	{
		std::ostringstream sout;
		sout << data;
		return sout.str();
	}
};
#endif

